<?php

use app\middleware\ApiMiddleware;
use think\facade\Route;
use think\middleware\AllowCrossDomain;
use think\middleware\CheckRequestCache;
use think\middleware\SessionInit;

$middleware = [
    //     全局请求缓存
//    CheckRequestCache::class,
//     Session初始化
    SessionInit::class,
    ApiMiddleware::class,
    AllowCrossDomain::class
];
Route::group("api", function () {
    Route::group("station", function () {
        Route::get("list", "api.station/lst");
        Route::get("detail", "api.station/detail");
    });
    Route::group("user", function () {
        Route::get("detail", "api.user/detail");
        Route::post("sms", "api.user/get_sms_code");
        Route::post("login", "api.user/login");
    });
    Route::group("order",function () {
        Route::post("create", "api.order/create");
        Route::get("detail","api.order/detail");
        Route::get('discount',"api.order/mathDiscount");
    });
})->middleware($middleware);
